package service

import (
	"context"

	"gitee.com/thewalkers/refactoring-code/model"
)

// AddSalaryEmployeeTransaction struct for injecting an implementation of EmployeeRepository
// for use in service methods
type AddSalaryEmployeeTransactionService struct {
	AddSalaryEmployeeTransactionRepository model.AddSalaryEmployeeTransactionRepository
}

// ASConfig will hold repository that will eventually be injected into this
// service layer
type ASConfig struct {
	AddSalaryEmployeeTransactionRepository model.AddSalaryEmployeeTransactionRepository
}

// NewAddSalaryEmployeeTransactionService is a factory function for
// initializing a EmployeeService with its repository layer dependencies
func NewAddSalaryEmployeeTransactionService(a *ASConfig) model.AddSalaryEmployeeTransactionService {
	return &AddSalaryEmployeeTransactionService{
		AddSalaryEmployeeTransactionRepository: a.AddSalaryEmployeeTransactionRepository,
	}
}

func (a *AddSalaryEmployeeTransactionService) Create(ctx context.Context, e *model.Employee, s *model.SalariedClassification) error {
	return a.AddSalaryEmployeeTransactionRepository.Create(ctx, e, s)
}
